.editorBox {
    :global {
        .toolbar {
            display: flex;
            flex-wrap: nowrap;
            align-items: center;
            height: 40px;
            border: 1px solid rgba(0, 0, 0, 0.15);
            border-bottom: none;
            border-radius: 4px 4px 0 0;

            &_operator {
                display: flex;
                flex: 1;
                align-items: center;
                justify-content: space-between;
                padding: 0 8px;

                li {
                    width: 40px;
                    font-size: 14px;
                    line-height: 40px;
                    text-align: center;
                    cursor: pointer;

                    &:hover {
                        color: #ffa22d;
                    }
                }
            }

            &_line {
                width: 1px;
                height: 20px;
                background: #eaeaea;
            }

            &_menu {
                position: relative;
                display: flex;
                //cursor: pointer;
                padding: 0 30px;
            }

            &_panel {
                position: relative;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                cursor: pointer;

                &:hover {
                    color: #ffa22d;

                    .toolbar_panel_triangle {
                        width: 0;
                        height: 0;
                        border-top: none;
                        border-right: 3px solid transparent;
                        border-bottom: 4px solid #ffa22d;
                        border-left: 3px solid transparent;
                    }

                    .toolbar_panel_box {
                        display: block;
                    }
                }

                &_box {
                    position: absolute;
                    top: -210px;
                    left: -92px;
                    z-index: 9999;
                    display: none;
                    width: 194px;
                    height: 210px;

                    .toolbar_panel_item {
                        display: flex;
                        flex-wrap: wrap;
                        align-items: center;
                        justify-content: space-between;
                        box-sizing: border-box;
                        width: 194px;
                        height: 205px;
                        padding: 8px;
                        background: #f7f7f7;
                        box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.12);

                        li {
                            width: 54px;
                            height: 40px;
                            margin-bottom: 8px;
                            color: rgba(0, 0, 0, 0.85);
                            font-weight: 500;
                            font-size: 24px;
                            line-height: 40px;
                            text-align: center;
                            background: #fff;
                            border-radius: 2px;

                            &:hover {
                                color: #ffa22d;
                                background: #fffbf0;
                            }
                        }

                        li:nth-last-child(2) {
                            width: 116px;
                            margin-bottom: 0;
                        }

                        li:nth-last-child(1) {
                            margin-bottom: 0;
                        }
                    }
                }

                &_title {
                    font-size: 14px;
                    line-height: 22px;
                }

                &_triangle {
                    width: 0;
                    height: 0;
                    border-top: 4px solid #595959;
                    border-right: 3px solid transparent;
                    border-left: 3px solid transparent;

                    &:hover {
                        width: 0;
                        height: 0;
                        border-top: none;
                        border-right: 3px solid transparent;
                        border-bottom: 4px solid #ffa22d;
                        border-left: 3px solid transparent;
                    }
                }
            }
        }

        .editor-body {
            position: relative;
        }

        .editor-placeholder {
            position: absolute;
            top: 0;
            z-index: 1;
            padding: 4px 11px;
            color: #bfbfbf;
            line-height: 22px;
        }

        /* 编辑器样式 */

        .editor {
            position: relative;
            z-index: 2;
            //margin: 20px;
            height: 114px;
            padding: 4px 11px;
            overflow: auto;
            color: #000;
            line-height: 22px;
            background: transparent;
            border: 1px solid rgba(0, 0, 0, 0.15);
            border-bottom-right-radius: 4px;
            border-bottom-left-radius: 4px;
            cursor: text;
            caret-color: orange;

            /* 解决在safari下多光标的问题 */
            &:not(:empty) {
                caret-color: transparent;
            }

            &:active,
            &:focus {
                outline: 0 solid transparent;
                cursor: text;
            }

            :active,
            :focus {
                outline: 0 solid transparent;
                cursor: text;
            }
        }

        /* 公式样式 */

        .formula {
            display: inline-block;
            margin-top: 2px;
            margin-bottom: 2px;
            outline: 0 solid transparent;
            cursor: text;
            caret-color: orange;

            &-blank {
                white-space: pre;
            }

            &-number {
                margin-right: 5px;
                margin-left: 5px;
                color: #f27076;
            }

            &-operator {
                margin-right: 5px;
                margin-left: 5px;
                color: #c88fec;
            }

            &-condition {
                margin-right: 5px;
                margin-left: 5px;
                padding-right: 5px;
                padding-left: 5px;
                color: #c2e988;
                background: #e64c18;
                border-radius: 3px;
            }

            &-illegal,
            &-error {
                position: relative;
                color: red;
                border-bottom: 1px solid red;
            }
        }

        // 在ie11下能不用display: inline-block,ie在可编辑的情况下会出现虚框
        @media all and (-ms-high-contrast: none) {
            *::-ms-backdrop,
            .formula,
            .formula-group-title,
            .formula-group-children {
                display: inline;
            }

            .formula-group-title {
                &:read-write:focus {
                    outline: none;
                }
            }
        }

        /* 黑色主题 */

        .theme-dark {
            &.editor-placeholder {
                background: #292d3f;
            }

            .formula {
                &-number {
                    color: #f27076;
                }

                &-operator {
                    margin-right: 5px;
                    margin-left: 5px;
                }

                &-condition {
                    color: #c2e988;
                    background: #e64c18;
                }

                &-illegal,
                &-error {
                    color: red;
                }
            }
        }

        /* 轻色主题 */

        .theme-light {
            &.editor-placeholder {
                background: #fff;
            }

            .formula {
                &-number {
                    color: #faa808;
                    //color: #5BD8A6;
                }

                &-operator {
                    color: #4e6ef3;
                }

                &-condition {
                    color: #6dc8ec;
                    background: #efefe7;
                }

                &-group {
                    &-title {
                        color: #26a5ad;
                    }
                }

                &-illegal,
                &-error {
                    color: red;
                }
            }
        }

        .hide {
            display: none;
        }

        .condition {
            position: absolute;
            z-index: 200;
            width: auto;
            min-width: 150px;
            padding: 0;
            overflow: auto;
            background: #fff;
            border: 1px solid #d9d9d9;
            border-radius: 8px;
            box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.12);
            cursor: pointer;

            .condition-input {
                margin: 12px 12px 10px 12px;
                padding-right: 12px;
                padding-left: 12px;
                line-height: 2;
                border: 1px solid #d9d9d9;
                border-radius: 4px;

                &:hover,
                &:focus,
                &:active {
                    border-color: #ffb957;
                    outline: none;
                }

                &:active {
                    border-color: #ffb957;
                    box-shadow: 0 0 0 2px rgba(255, 162, 45, 0.2);
                }
            }

            .condition-list {
                max-height: 230px;
                margin-bottom: 0;
                padding-top: 5px;
                padding-left: 0;
                overflow: auto;

                > ul {
                    padding: 0;
                    > .condition-item {
                        padding: 0 12px 0 24px;
                        line-height: 2;

                        &.condition-item--highlight,
                        &:hover {
                            background: #fffbef;
                        }
                    }
                }
            }
        }

        .formula-validate {
            position: relative;
            line-height: 22px;
            white-space: nowrap;
            word-break: break-all;

            &-error {
                color: red;
            }

            &-warn {
                color: #fcae00;
            }
        }
    }

    &.editorBoxDisabled {
        :global {
            .toolbar {
                color: rgba(0, 0, 0, 0.25);
                cursor: not-allowed;

                &_panel {
                    &:hover {
                        color: rgba(0, 0, 0, 0.25);
                        cursor: not-allowed;

                        .toolbar_panel_triangle {
                            width: 0;
                            height: 0;
                            border-top: none;
                            border-right: 3px solid transparent;
                            border-bottom: 4px solid rgba(0, 0, 0, 0.25);
                            border-left: 3px solid transparent;
                        }

                        .toolbar_panel_box {
                            display: none;
                        }
                    }

                    &_triangle {
                        width: 0;
                        height: 0;
                        border-top: 4px solid rgba(0, 0, 0, 0.25);
                        border-right: 3px solid transparent;
                        border-left: 3px solid transparent;

                        &:hover {
                            width: 0;
                            height: 0;
                            border-top: none;
                            border-right: 3px solid transparent;
                            border-bottom: 4px solid rgba(0, 0, 0, 0.25);
                            border-left: 3px solid transparent;
                        }
                    }
                }
                &_box .toolbar_panel_item li &:hover {
                    color: rgba(0, 0, 0, 0.25);
                    cursor: not-allowed;
                }
            }

            .editor-body {
                background: #f5f5f5;
            }
        }
    }
}

.toolbarDropDown {
    max-height: 250px;
    overflow: auto;
}
